<template>
	<div>
		<view class="flex" >
			
			<view class="title">
				<text>从书架删除</text>
			</view>
			
			<view class="message">
				<text>确定要删除这所选的{{this.selcetCount.length}}本书籍吗？</text>
			</view>
			
			<view class="buttun">
				<button type="warn" size="" @click="deleteforid">删除</button>
				<button type="default" @click="cancel">取消</button>
			</view>
			
		</view>
	</div>
</template>

<script>
	export default {
		created() {
			
		},
		mounted() {
			this.$bus.$on('getDeletArray',(msg) => {
			this.selcetCount = msg
			
			})
		},
		data() {
			return {
				selcetCount:[]
			}
		},
		methods: {
			deleteforid() {
				let dataArray = this.selcetCount
				console.log(dataArray)
				
				console.log( this.$store.getters.getUserSelectBook(dataArray) )
				this.$store.commit( {
					type:'deleteUserBook',
					arry:dataArray
				} )
				
				location.reload()
				
			},
			cancel(){
				this.$emit('deleteCancel','')
			}
			
		},
	}
</script>

<style lang='scss' scoped>
	.flex{
		position: absolute;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background-color: #DCDCDC;
		width: 100%;
		height: 100px;
		font-size: 15px;
		bottom:-100px;
	}
	.buttun{
		height: 50px;
		display: flex;
		justify-content: space-around;
	}
	button{
		margin:10px ;
		font-size: 15px;
		width: 100px;
		height: 40px;
	}
	
	
	
	
</style>